package com.test.demo.webflux.web.controller;

import com.test.demo.webflux.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;

@RestController
@RequestMapping("webflux")
public class WebfluxController {

    @Autowired
    private TestService testService;

    @GetMapping("t1")
    public Mono t1() {
        return Mono.just(testService.t1());
    }

    @GetMapping("t2")
    public Mono t2() {
        return Mono.just(testService.t2());
    }

}
